import { $get, $post, $put } from '@js/request'
import { EmployeeSchema } from '@src/components/schema/employeeSchema'

// 获取秘书列表
export async function getPersonList (): Promise<string[]> {
  const res = await $get('/api/common/employee', { page: 1, limit: 1000 })
  return res.data.list.map((li: EmployeeSchema) => li.realname)
}

// 新增审核
export async function addRequest (d: { [k: string]: any }): Promise<void> {
  const res = await $post('/api/commission/performance', d)
  return res.data
}

// 修改审核
export async function updateRequest (d: { [k: string]: any }): Promise<void> {
  const id: string = d.id
  delete d.id
  const res = await $put(`/api/commission/performance/${id}`, d)
  return res.data
}
